package com.meitianhui.convenitenbuy.module.order.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.text.TextUtils;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.meitianhui.convenitenbuy.R;
import com.meitianhui.convenitenbuy.module.order.model.bean.FightGroupDetailPerson;
import com.meitianhui.convenitenbuy.util.GlideUtils;

import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2017/11/16.
 */

public class FightGroupOrderDetailAdapter extends BaseQuickAdapter<FightGroupDetailPerson.ListBean, BaseViewHolder> {
    private Context mContext;
    private Map<String, String> mUrlMap;

    public FightGroupOrderDetailAdapter(Context context, @Nullable List<FightGroupDetailPerson.ListBean> data, Map<String, String> urlMap) {
        super(R.layout.item_fight_group_order_detail, data);
        mContext = context;
        mUrlMap = urlMap;
    }


    @Override
    protected void convert(BaseViewHolder helper, FightGroupDetailPerson.ListBean item) {
        GlideUtils.setCircleImage(mContext,item.getHead_pic_path(), R.mipmap.wallet_coupon_item_default, R.mipmap.wallet_coupon_item_default,helper.getView(R.id.iv_head));
        String mobile = item.getMember_mobile();
        if (!TextUtils.isEmpty(mobile) && mobile.length() == 11) {
            mobile = mobile.substring(0, 3) + "****" + mobile.substring(7, mobile.length());
        }
        helper.setText(R.id.tv_mobile,mobile);
        helper.setText(R.id.tv_time,item.getOrder_date());


    }
    public void setNewData(List data, Map<String, String> map) {
        setNewData(data);
        this.mUrlMap = map;
    }
}
